package com.dz.userService.impl;


import com.dz.Mapper.empDao;
import com.dz.Mapper.userDao;
import com.dz.domain.emp;
import com.dz.domain.loginUserInf;
import com.dz.domain.user;
import com.dz.userService.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    userDao userdao;

    @Override
    public user findById(user us) {
        return userdao.findById(us);
    }

    @Override
    public int userNum() {
        return userdao.userNum();
    }

    @Override
    public user findByIdTwo(int id) {
        return userdao.findByIdTwo(id);
    }

    @Override
    public int insertUser(emp e) {
        int row = userdao.insertUser(e);
        return row;
    }

    @Override
    public boolean findLoginSys(user us) {
        user userInf = userdao.findLoginSys(us);
       if (userInf != null){
           return true;
       }else{
           return false;
       }
    }

    /**
     * 查询所有用户
     * */
    @Override
    public List<emp> findTestVueAll() {
        return userdao.findTestVueAll();
    }

    @Override
    public int inLoginDate(String loginname, Date loginDate) {
        return userdao.inLoginDate(loginname, loginDate);
    }


}
